/**
 * Redis 缓存
 */

const redis = require('redis');
const globalConfig = require('../../config/global_config');
const redisOptions = globalConfig.redis;

const redisClient = redis.createClient(redisOptions)

redisClient.on('error', function (err) {
  console.log('Error ' + err)
})

redisClient.on('connect', function () {
  console.log('Redis is ready')
})

exports.redis = redis
exports.redisClient = redisClient
